/*
 * Copyright 2008 Max Kugland
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.splink.library.tween {
	import org.splink.library.queue.IQable;
	import org.splink.library.tween.sprop.ISpecialProp;

	/**
	 * An <code>IQable</code> tween which tweens a bunch of given properties within the
	 * given duration from their start value to a given end value by applying a given
	 * easing function.
	 * 
	 * If the <code>IQTween</code> starts a <code>QCompleteEvent.START</code> is distributed.	 * If the <code>IQTween</code> progresses a <code>QCompleteEvent.PROGRESS</code> is distributed.	 * If the <code>IQTween</code> completes a <code>QCompleteEvent.COMPLETE</code> is distributed.
	 * 
	 * @see org.splink.library.tween.QTween
	 * @see org.splink.library.queue.QEvent
	 * @see org.splink.library.queue.IQable
	 * 
	 * @author Max Kugland
	 */
	public interface IQTween extends IQable {
		
		/**
		 * Adds a property to the <code>IQTween</code>
		 * 
		 * @param prop the property name
		 * @param to the target value of the property
		 * @param from an optional start value of the property, when the <code>IQTween</code> 
		 * starts all properties are set to their <code>from</code> value unless it's <code>NaN</code>
		 * @param sprop an optional adapter to deal with special properties like filters and colors 
		 */
		function add(prop : String, to : Number, from : Number = NaN, sprop : ISpecialProp = null) : IQTween;
		
		/**
		 * @param duration the duration of the tween in milliseconds
		 * @return a reference to this <code>IQTween</code>
		 */
		function duration(duration : uint) : IQTween;
		
		/**
		 * @param delay the delay of the tween in milliseconds
		 * @return a reference to this <code>IQTween</code>
		 */
		function delay(delay : uint) : IQTween;
		
		/**
		 * @param easing the easing function to use
		 * @return a reference to this <code>IQTween</code>
		 */
		function easing(ease : Function) : IQTween;
	}
}
